package com.hxd.mall.module.usercenter.nick

import android.content.Intent
import android.graphics.Color
import com.alibaba.android.arouter.facade.annotation.Route
import com.hxd.mall.R
import com.hxd.mall.base.BaseInjectActivity
import com.hxd.mall.constant.HxdConstantsRouterPath.PathUserCenter.path_user_center_nick
import com.hxd.mall.widget.HxdTitleBarView
import crossoverone.statuslib.StatusUtil
import kotlinx.android.synthetic.main.activity_nick_layout.*

/**
 * 昵称修改页
 */
@Route(path = path_user_center_nick)
class NickActivity : BaseInjectActivity<INickPresenter>(), INickView {

    override fun attachLayoutRes(): Int = R.layout.activity_nick_layout

    override fun initViews() {
        setTitle()
        clear.setOnClickListener {
            nickName.text.clear()
        }
    }

    override fun initData() {
    }

    override fun showData() {

    }

    override fun setStatusColor() {
        StatusUtil.setUseStatusBarColor(this, Color.WHITE)
    }

    override fun setSystemInvadeBlack() {
        StatusUtil.setSystemStatus(this, false, true)
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        /*if (resultCode === ImagePicker.RESULT_CODE_ITEMS) {
            if (data != null && requestCode === IMAGE_PICKER) {
                val images =
                    data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS) as ArrayList<ImageItem>
                val adapter = MyAdapter(images)
                gridView.setAdapter(adapter)
            } else {
                Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show()
            }
        }*/
    }

    private fun setTitle() {
        HxdTitleBarView(this).setTitleName(getString(R.string.nick_settting)).setTitleLeftJustImg()
            .setTitleRightJustText(
                getString(
                    R.string.finish
                )
            )
            .setTitleRightTextColor(resources.getColor(R.color.color_E24840))
            .setOnLeftClickedListenerCommon()
            .setOnRightClickedListener {
                finish()
            }
    }
}
